package com.ruoyi.Util;

import com.ruoyi.Course.domain.StudyCourse;
import com.ruoyi.Course.service.impl.StudyCourseServiceImpl;
import com.ruoyi.Label.domain.StudyLable;
import com.ruoyi.Label.service.impl.StudyLableServiceImpl;
import com.ruoyi.Unit.domain.StudyUnit;
import com.ruoyi.Unit.mapper.StudyUnitMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
@RequestMapping("/Util/Util")
public class Util {
    @Autowired
    StudyCourseServiceImpl studyCourseService ;
    @Autowired
    StudyLableServiceImpl studyLableService;
    @Autowired
    private StudyUnitMapper studyUnitMapper;
    @GetMapping("/CourseList")
    public List<StudyCourse> GetCourseList(){
        return studyCourseService.selectStudyCourseList(new StudyCourse());
    }

    @GetMapping("/GetUnit")
    public List<StudyUnit> GetUnit(){
        return studyUnitMapper.selectStudyUnitList(new StudyUnit());
    }


    @GetMapping("/GetLabel")
    public List<StudyLable> GetLabel(){
        return studyLableService.selectStudyLableList(new StudyLable());
    }

    //获取当前用户的默认卡包
    @GetMapping(value = "/GetDefaultCourse")
    public StudyCourse GetDefaultCourse()
    {
        return studyCourseService.GetDefaultCourse();
    }
}
